spinner: don't expand to fill the allocated space
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Thu, 10 Oct 2013 20:54:16 +0000 (16:54 -0400)
committerWilliam Jon McCann <william.jon.mccann@gmail.com>
Fri, 11 Oct 2013 12:38:37 +0000 (08:38 -0400)
Spinners are essentially animated symbolic icons. We don't really
want them being rendered to arbitrary sizes. Also the current
technique for rendering the activity is not suitable for larger
sizes. Until we have a better technique we should limit the size
to the MENU icon size or exactly twice that size.

gtk/gtkspinner.c

index 50ae61341ea3e66d24fcb240af547140fb3fec29..ec882b1add55eb07d8071ae20fdf708b6a54f2db 100644 (file)
@@ -52,7 +52,7 @@
  */
 
 
-#define SPINNER_SIZE 12
+#define SPINNER_SIZE 16
 
 enum {
   PROP_0,
@@ -205,6 +205,12 @@ gtk_spinner_draw (GtkWidget *widget,
   height = gtk_widget_get_allocated_height (widget);
   size = MIN (width, height);
 
+  /* at most allow a double size spinner */
+  if (size >= 3 * SPINNER_SIZE)
+    size = SPINNER_SIZE * 2;
+  else
+    size = SPINNER_SIZE;
+
   gtk_render_activity (context, cr,
                        (width - size) / 2,
                        (height - size) / 2,